import request from './request.js'

export function postNewAddress(e,isDefault){
	return request.post("/addAddress",{
		name: e.name,
		tel:e.tel,
		province: e.province,
		city:e.city,
		county: e.county,
		addressDetail:e.addressDetail,
		areaCode: e.areaCode,
		postalCode:	e.postalCode,
		isDefault: isDefault
	})
}

export function getAddressByAid(e){
	return request.get("/findAddressByAid",{
		aid:e
	})
}

export function postEditAddress(aid,e,isDefault){
	return request.post("/editAddress",{
		aid: aid,
		name: e.name,
		tel: e.tel,
		province: e.province,
		city: e.city,
		county: e.county,
		addressDetail: e.addressDetail,
		areaCode: e.areaCode,
		postalCode: e.postalCode,
		isDefault: isDefault
	})
}

export function postDelAddress(e){
	return request.post("/deleteAddress",{
		aid:e
	})
}

